<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2021-09-15
  Time: 18:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="col-md-9">



    <div class="data_list">
        <div class="data_list_title"><span class="glyphicon glyphicon glyphicon-th-list"></span>&nbsp;
            论坛文章 </div>
        <c:if test="${empty page}">
            <h2>请发表您的第一篇文章以进入社区论坛！</h2>

        </c:if>
        <c:if test="${!empty page}">



        <table id="myTable" class="table table-hover table-striped ">
            <tbody>
            <tr>
                <th>发布时间</th>
                <th>发布者</th>
                <th>文章类型</th>
                <th>文章题目</th>
            </tr>

                <c:forEach items="${page.dataList}" var="item">
            <tr>
                <td>${item.pubTime}</td>
                <td>${item.uname}</td>
                <td>${item.typeName}</td>
                <td>
                    <a href="modify?actionName=detail&noteId=${item.noteId} ">${item.title}</a>


                </td>
            </tr>
<%--                <li>${item.pubTime}&nbsp;&nbsp;&nbsp;${item.uname}&nbsp;&nbsp;&nbsp;${item.typeName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="modify?actionName=detail&noteId=${item.noteId} ">${item.title}</a> </li>--%>
                </c:forEach>

            </tbody>
        </table>


        <nav style="text-align: center">
            <ul class="pagination   center">
                <c:if test="${page.pageNum>1}">
                <li>
                    <a href="index?pageNum=${page.prePage}">
                        <span>←</span>
                    </a>
                </li>

                </c:if>
                <c:forEach begin="${page.startNavPage}" end="${page.endNavPage}" var="p">
                <li <c:if test="${page.pageNum== p}"> class="active" </c:if>  >
                    <a href="index?pageNum=${p}">${p}</a>
                </li>
                </c:forEach>
                <c:if test="${page.pageNum<page.totalPages}">
                <li>
                    <a href="index?pageNum=${page.nextPage}">
                        <span>→</span>
                    </a>
                </li>
                </c:if>
            </ul>
        </nav>
        </c:if>
    </div>

</div>
